@echo off
REM ====== 阶段2：后端API化改造 ======
set PROJECT_ROOT=D:\phpstudy_pro\WWW\oa.laizone.com
cd /d %PROJECT_ROOT%

REM 生成路由报告
php think analyze:structure --output=report.json

REM 生成OpenAPI规范
php think extract:routes --format=openapi --output=openapi.yaml

REM 创建API路由文件
php think generate:api-routes --input=report.json --output=route\api.php

REM 转换控制器
php think convert:controllers ^
  --source=app/controller ^
  --target=app/controller/api ^
  --strategy=json-response

REM 创建JWT中间件
php think make:middleware JwtAuth --template=jwt

echo 阶段2完成：后端API化改造完成
pause